﻿<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="ContactPointList.ascx.cs" Inherits="CustomerService.ContactPointList" %>
<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<script type="text/javascript" language="javascript">
    function btnAddContactPoint_onclick() {
        TearOff("AddContactPoint.aspx?PersonID=<%=_customer.Person.PersonID.ToString() %>", "AddContactPoint", "200", "150");
    }
</script>
<asp:UpdatePanel ID="contactPointPanel" runat="server">
<ContentTemplate>
<div class="orderform">
    <table cellpadding="0" cellspacing="0" class="CustomerEntry" style="border: 1px solid black;" >
        <tr>
            <td colspan="3">
                Contact Points:
            </td>
        </tr>
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="ContactPointID" >
            <LayoutTemplate>
                <tr id="itemPlaceholder" runat="server"></tr>
            </LayoutTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <%# Eval("ContactPointType.Description")  %>
                    </td>
                    <td class="half">
                        <asp:TextBox ID="txtContactPointValue" runat="server" Text='<%# Bind("Value") %>' />
                    </td>
                    <td>
                        <asp:Button ID="btnRemoveContactPoint" runat="server" Text="Del" 
                            CommandName="Delete" CommandArgument='<%# Eval("ContactPointID") %>'
                            OnCommand="btnRemove_Click" Width="30"
                             />
                    </td>
                </tr>
            </ItemTemplate>
        </asp:ListView>
        <tr>
            <td class="half" style="padding: 5 5 5 5;" colspan="3">
                &nbsp<input type="button" onclick="btnAddContactPoint_onclick();" value="Add..."/>
            </td>
        </tr>
    </table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
